home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / InputEvent.mod < prev    next >
Text File  |  1994-08-08  |  11KB  |  304 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: InputEvent.mod $
  4.   Description: input event definitions
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:53:42 $
  10.  
  11.   $VER: inputevent.h 36.10 (26.6.92)
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. MODULE InputEvent;
  24.  
  25. (*
  26. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  27. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  28. ** $V- OvflChk       $Z- ZeroVars
  29. *)
  30.  
  31. IMPORT E := Exec, U := Utility, T := Timer;
  32.  
  33.  
  34. (* ----- constants --------------------------------------------------*)
  35.  
  36. CONST
  37.  
  38. (*  --- InputEvent.ieClass --- *)
  39. (* A NOP input event *)
  40.   classNull *                  = 00H;
  41. (* A raw keycode from the keyboard device *)
  42.   classRawKey *                = 01H;
  43. (* The raw mouse report from the game port device *)
  44.   classRawMouse *              = 02H;
  45. (* A private console event *)
  46.   classEvent *                 = 03H;
  47. (* A Pointer Position report *)
  48.   classPointerPos *            = 04H;
  49. (* A timer event *)
  50.   classTimer *                 = 06H;
  51. (* select button pressed down over a Gadget (address in ieEventAddress) *)
  52.   classGadgetDown *            = 07H;
  53. (* select button released over the same Gadget (address in ieEventAddress) *)
  54.   classGadgetUp *              = 08H;
  55. (* some Requester activity has taken place.  See Codes REQCLEAR and REQSET *)
  56.   classRequester *             = 09H;
  57. (* this is a Menu Number transmission (Menu number is in ieCode) *)
  58.   classMenuList *              = 0AH;
  59. (* User has selected the active Window's Close Gadget *)
  60.   classCloseWindow *           = 0BH;
  61. (* this Window has a new size *)
  62.   classSizeWindow *            = 0CH;
  63. (* the Window pointed to by ieEventAddress needs to be refreshed *)
  64.   classRefreshWindow *         = 0DH;
  65. (* new preferences are available *)
  66.   classNewPrefs *              = 0EH;
  67. (* the disk has been removed *)
  68.   classDiskRemoved *           = 0FH;
  69. (* the disk has been inserted *)
  70.   classDiskInserted *          = 10H;
  71. (* the window is about to be been made active *)
  72.   classActiveWindow *          = 11H;
  73. (* the window is about to be made inactive *)
  74.   classInactiveWindow *        = 12H;
  75. (* extended-function pointer position report (V36) *)
  76.   classNewPointerPos *         = 13H;
  77. (* Help key report during Menu session (V36) *)
  78.   classMenuHelp *              = 14H;
  79. (* the Window has been modified with move, size, zoom, or change (V36) *)
  80.   classChangeWindow *          = 15H;
  81.  
  82. (* the last class *)
  83.   classMax *                   = 15H;
  84.  
  85.  
  86. (*  --- InputEvent.ieSubClass --- *)
  87. (*  NewPointerPos *)
  88. (*      like PointerPos *)
  89.   subClassCompatible * = 00H;
  90. (*      InputEvent.eventAddress points to PointerPixel) *)
  91.   subClassPixel *      = 01H;
  92. (*      InputEvent.eventAddress points to PointerTablet) *)
  93.   subClassTablet *     = 02H;
  94. (*      InputEvent.eventAddress points to NewTablet *)
  95.   subClassNewTablet *  = 03H;
  96.  
  97. TYPE
  98.  
  99.   IEDummyPtr * = CPOINTER TO IEDummy;
  100.   IEDummy * = RECORD END;
  101.  
  102. (* pointed to by InputEvent.eventAddress for classNewPointerPos,
  103.  * and subClassPixel.
  104.  *
  105.  * You specify a screen and pixel coordinates in that screen
  106.  * at which you'd like the mouse to be positioned.
  107.  * Intuition will try to oblige, but there will be restrictions
  108.  * to positioning the pointer over offscreen pixels.
  109.  *
  110.  * qualRelativeMouse is supported for subClassPixel.
  111.  *)
  112.  
  113.   PointerPixelPtr* = CPOINTER TO PointerPixel;
  114.   PointerPixel* = RECORD
  115.     screen* : E.APTR;    (*Intuition.ScreenPtr*);
  116.                          (* pointer to an open screen *)
  117.     position* : RECORD   (* pixel coordinates in screen *)
  118.       x * :INTEGER;
  119.       y * :INTEGER;
  120.     END;
  121.   END; (* PointerPixel *)
  122.  
  123. (* pointed to by InputEvent.eventAddress for classNewPointerPos,
  124.  * and subClassTablet.
  125.  *
  126.  * You specify a range of values and a value within the range
  127.  * independently for each of X and Y (the minimum value of
  128.  * the ranges is always normalized to 0).
  129.  *
  130.  * Intuition will position the mouse proportionally within its
  131.  * natural mouse position rectangle limits.
  132.  *
  133.  * qualRelativeMouse is not supported for subClassTablet.
  134.  *)
  135.  
  136.   PointerTabletPtr* = CPOINTER TO PointerTablet;
  137.   PointerTablet* = RECORD
  138.     range * : RECORD      (* 0 is min, these are max *)
  139.       x * : E.UWORD;
  140.       y * : E.UWORD;
  141.     END;
  142.     value * : RECORD      (* between 0 and Range *)
  143.       x * : E.UWORD;
  144.       y * : E.UWORD;
  145.     END;
  146.     pressure * :INTEGER;  (* -128 to 127 (unused, set to 0) *)
  147.   END; (* PointerTablet *)
  148.  
  149.  
  150. (* The InputEvent.eventAddress of an classNewPointerPos event of subclass
  151.  * subClassNewTablet points at a NewTablet structure.
  152.  *
  153.  *
  154.  * qualRelativeMouse is not supported for subClassNewTablet.
  155.  *)
  156.  
  157.   NewTabletPtr * = CPOINTER TO NewTablet;
  158.   NewTablet * = RECORD
  159.     (* Pointer to a hook you wish to be called back through, in
  160.      * order to handle scaling.  You will be provided with the
  161.      * width and height you are expected to scale your tablet
  162.      * to, perhaps based on some user preferences.
  163.      * If NULL, the tablet's specified range will be mapped directly
  164.      * to that width and height for you, and you will not be
  165.      * called back.
  166.      *)
  167.     callBack * :  U.HookPtr;
  168.  
  169.     (* Post-scaling coordinates and fractional coordinates.
  170.      * DO NOT FILL THESE IN AT THE TIME THE EVENT IS WRITTEN!
  171.      * Your driver will be called back and provided information
  172.      * about the width and height of the area to scale the
  173.      * tablet into.  It should scale the tablet coordinates
  174.      * (perhaps based on some preferences controlling aspect
  175.      * ratio, etc.) and place the scaled result into these
  176.      * fields.  The ient_ScaledX and ient_ScaledY fields are
  177.      * in screen-pixel resolution, but the origin ( [0,0]-point )
  178.      * is not defined.  The ient_ScaledXFraction and
  179.      * ient_ScaledYFraction fields represent sub-pixel position
  180.      * information, and should be scaled to fill a UWORD fraction.
  181.      *)
  182.     scaledX *, scaledY * : E.UWORD;
  183.     scaledXFraction *, scaledYFraction * :  E.UWORD;
  184.  
  185.     (* Current tablet coordinates along each axis: *)
  186.     tabletX *, tabletY * :  E.ULONG;
  187.  
  188.     (* Tablet range along each axis.  For example, if ient_TabletX
  189.      * can take values 0-999, ient_RangeX should be 1000.
  190.      *)
  191.     rangeX *, rangeY * :  E.ULONG;
  192.  
  193.     (* Pointer to tag-list of additional tablet attributes.
  194.      * See <intuition/intuition.h> for the tag values.
  195.      *)
  196.     tagList * : U.TagListPtr;
  197.   END;
  198.  
  199. CONST
  200.  
  201. (*  --- InputEvent.ieCode --- *)
  202. (*  rawKey *)
  203.   codeUpPrefix *             = 80H;
  204.   codeKeyCodeFirst *         = 00H;
  205.   codeKeyCodeLast *          = 77H;
  206.   codeCommCodeFirst *        = 78H;
  207.   codeCommCodeLast *         = 7FH;
  208.  
  209. (*  ANSI *)
  210.   codeC0First *              = 00H;
  211.   codeC0Last *               = 1FH;
  212.   codeAsciiFirst *           = 20H;
  213.   codeAsciiLast *            = 7EH;
  214.   codeAsciiDel *             = 7FH;
  215.   codeC1First *              = 80H;
  216.   codeC1Last *               = 9FH;
  217.   codeLatin1First *          = 0A0H;
  218.   codeLatin1Last *           = 0FFH;
  219.  
  220. (*  RawMouse *)
  221.   codeLButton *              = 68H;    (* also uses UpPREFIX *)
  222.   codeRButton *              = 69H;
  223.   codeMButton *              = 6AH;
  224.   codeNoButton *             = 0FFH;
  225.  
  226. (*  Event (V36) *)
  227.   codeNewActive *            = 01H;    (* new active input window *)
  228.   codeNewSize *              = 02H;    (* resize of window *)
  229.   codeRefresh *              = 03H;    (* refresh of window *)
  230.  
  231. (*  Requester *)
  232. (*      broadcast when the first Requester (not subsequent ones) opens up in *)
  233. (*      the Window *)
  234.   codeReqSet *               = 01H;
  235. (*      broadcast when the last Requester clears out of the Window *)
  236.   codeReqClear *             = 00H;
  237.  
  238.  
  239.  
  240. (*  --- InputEvent.ieQualifier --- *)
  241.   qualLShift *           = 0;
  242.   qualRShift *           = 1;
  243.   qualCapsLock *         = 2;
  244.   qualControl *          = 3;
  245.   qualLAlt *             = 4;
  246.   qualRAlt *             = 5;
  247.   qualLCommand *         = 6;
  248.   qualRCommand *         = 7;
  249.   qualNumericPad *       = 8;
  250.   qualRepeat *           = 9;
  251.   qualInterrupt *        = 10;
  252.   qualMultiBroadcast *   = 11;
  253.   qualMidButton *        = 12;
  254.   qualRightButton *      = 13;
  255.   qualLeftButton *       = 14;
  256.   qualRelativeMouse *    = 15;
  257.  
  258. (* ----- InputEvent -------------------------------------------------*)
  259.  
  260. TYPE
  261.  
  262.   InputEventBasePtr* = CPOINTER TO InputEventBase;
  263.   InputEventBase* = RECORD END;
  264.  
  265.   InputEventPtr* = CPOINTER TO InputEvent;
  266.   InputEvent* = RECORD (InputEventBase)
  267.     nextEvent*  : InputEventBasePtr; (* the chronologically next event *)
  268.     class *     : E.UBYTE;   (* the input event class *)
  269.     subClass *  : E.UBYTE;   (* optional subclass of the class *)
  270.     code *      : E.UWORD;   (* the input event code *)
  271.     qualifier*  : E.WSET;    (* qualifiers in effect for the event*)
  272.     x *         : INTEGER;   (* the pointer position for the event*)
  273.     y *         : INTEGER;
  274.     timeStamp * : T.TimeVal; (* the system tick at the event *)
  275.   END; (* InputEvent *)
  276.  
  277.   InputEventAdrPtr* = CPOINTER TO InputEventAdr;
  278.   InputEventAdr* = RECORD (InputEventBase)
  279.     nextEvent*  : InputEventBasePtr; (* the chronologically next event *)
  280.     class *     : E.UBYTE;    (* the input event class *)
  281.     subClass *  : E.UBYTE;    (* optional subclass of the class *)
  282.     code *      : E.UWORD;    (* the input event code *)
  283.     qualifier*  : E.WSET;     (* qualifiers in effect for the event*)
  284.     addr *      : IEDummyPtr; (* the event address *)
  285.     TimeStamp * : T.TimeVal;  (* the system tick at the event *)
  286.   END; (* InputEventAdr *)
  287.  
  288.   InputEventPrevPtr* = CPOINTER TO InputEventPrev;
  289.   InputEventPrev* = RECORD (InputEventBase)
  290.     nextEvent*      : InputEventBasePtr; (* the chronologically next event *)
  291.     class *         : E.UBYTE;    (* the input event class *)
  292.     subClass *      : E.UBYTE;    (* optional subclass of the class *)
  293.     code *          : E.UWORD;    (* the input event code *)
  294.     qualifier*      : E.WSET;     (* qualifiers in effect for the event*)
  295.     prev1DownCode * : E.UBYTE;    (* previous down keys for dead *)
  296.     prev1DownQual * : E.BSET;     (*   key translation: the ieCode *)
  297.     prev2DownCode * : E.UBYTE;    (*   & low byte of ieQualifier for *)
  298.     prev2DownQual * : E.BSET;     (*   last & second last down keys *)
  299.     timeStamp *     : T.TimeVal;  (* the system tick at the event *)
  300.   END; (* InputEventPrev *)
  301.  
  302.  
  303. END InputEvent.
  304.